#!/bin/bash
# 
# File: move-tunnel-sites.sh
# Purpose: move tunnel sites file
#

cd $(dirname "$0")
. ./common.sh

INSTALLDIR=$(cd "$(dirname "$0")"; pwd);
src_dir=$INSTALLDIR/$config_dir
dist_dir=$INSTALLDIR/$config_tmp_dir

test "$1" && tunnelsites="$@" || tunnelsites=$(./sites.sh)

for tunnelsite in $tunnelsites; do
	tunnel_name=`echo ${tunnelsite} | cut -d = -f 1`;
	src_file=$src_dir/$tunnel_name;
	echo $src_file
	if test -f $src_file; then
		mv $src_file $dist_dir
	else
		warn '['$src_file'] not exist';
	fi
done
	





